#ifndef CONNECTOR_H
#define CONNECTOR_H

#include <defs/export.h>
#include <defs/global.h>

#include <core/entityobject.h>
#include <QSettings>
#include <Core/logger/logger.h>
#include "common.h"

namespace Opl
{
    namespace Helpers
    {
        O_PRIVATE_DECLARE(Connector);
        class HELPERS_EXPORT Connector : public Opl::Core::EntityObject
        {
                Q_OBJECT
            public:

                Connector(Opl::Core::EntityObject* parent = 0);
                virtual ~Connector();
                void Setup (const ConnectorSetup& setup);

            public slots:
                void Send(const QString& data);
                void Start();
                void Stop(bool force = false);

            signals:
                void output(const QString& data);
                void connected();
                void disconnected();
                void error();

            private slots:
                void threadConnected();
                void threadError();
                void threadDisconnected();
                void threadOutput(const QString& data);

            private:
                O_PRIVATE_DECLARE_MEMBER(Connector);
        };

    }
}


#endif // CONNECTOR_H

